package com.test.task;

import java.text.DateFormat;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 /**
  * 定时任务测试成功成功
  */
//@Component
public class TaskJob {
	/**
	 * 日志对象
	 */
	protected Logger logger = LoggerFactory.getLogger(getClass());
	
	 @Scheduled(cron = "*/5 * * * * ?")
	 public void print(){
	        String time = DateFormat.getDateTimeInstance().format(new Date());
	        logger.debug("定时器触发打印"+time);
	    }
}
